<?php

class Application_Form_Turnbericht extends Zend_Form
{
	protected $_haefen = array();
	
	public function getHaefen() {
		return $this->_haefen;
	}

	public function setHaefen($_haefen) {
		$this->_haefen = $_haefen;
	}
	
	
    public function init()
    {

        $this->setName("Turnbericht");
        $this->setMethod('post');
        

        $tag = new Zend_Form_Element_Text('tag');
        $tag->setLabel('Tag*:')
        ->setRequired(true)
        ->addValidator('Int', true)
        ->addFilter('HtmlEntities');
        
        $distanz = new Zend_Form_Element_Text('distanz');
        $distanz->setLabel('Distanz*:')
        ->setRequired(true)
        ->addValidator('Int', true)
        ->addFilter('HtmlEntities');

        
        $starthafen = new Zend_Form_Element_Select('starthafen');
        $starthafen ->setLabel('Starthafen:')
        ->addMultiOptions( $this->_haefen
        );
        
        $zielhafen = new Zend_Form_Element_Select('zielhafen');
        $zielhafen ->setLabel('Zielhafen:')
        ->addMultiOptions( $this->_haefen
        );
        
		/*
        $titel = new Zend_Form_Element_Text('titel');
        $titel->setLabel('Titel*:')
        	->setRequired(true)
        	->addFilter('HtmlEntities');
        */
        // create text area for Nachrichten
        $text = new Zend_Form_Element_Textarea('inhalt');
        $text->setLabel('Eintrag*:')
        	->setOptions(array(
        		'id' => 'bericht',
        		'rows' => '3',
        		'cols' => '55',
        		))
        	->setRequired(true)
        	->addFilter('HtmlEntities');
        		
		// create submit button
		$submit = new Zend_Form_Element_Submit('submit');
		$submit->setLabel('Submit')
		->setOptions(array('class' => 'submit'));
		
		
        // attach elements to form
        $this->addElement($tag)
        		->addElement($distanz)
        		->addElement($starthafen)
        		->addElement($zielhafen)
        		->addElement($text)
        		->addElement($submit);
    }


}

